package edu.qichen.onlineBlog.framework.validata.annptation;

import edu.qichen.onlineBlog.framework.validata.AtLeastOneNotNullValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target({TYPE})
@Retention(RUNTIME)
@Constraint(validatedBy = AtLeastOneNotNullValidator.class)
@Documented
public @interface AtLeastOneNotNull {
    String message() default "至少有一个不能为空";

    String[] value();

    Class<? extends Payload>[] payload() default {};

    Class<?>[] groups() default {};
}
